<?php

$dsn='sqlite:/tmp/base.db';
$sql="select * from T1";

$dbh=NULL;
try {
	$dbh=new PDO($dsn);
} catch(PDOException $e){
	echo "Erreur de connexion vers $dsn: ".$e->getMessage();
    exit(1);
}

$sth = $dbh->prepare($sql);
$sth->execute();
if ($sth->errorCode()=== '00000') {
		$result = $sth->fetchAll();
} else {
	print_r($sth->errorInfo());
}
	
$sth->closeCursor();

print_r($result);
?>
